<?php
defined('_JEXEC') or die;

class KetnoiControllerUsergroup extends JControllerLegacy
{
	public function save()
	{
		$model = $this->getModel("Usergroup");
		$table = $model->save();
		$isQuickCreate = $this->input->getBool("quickcreate");
		if($isQuickCreate)
		{
			$response = array();
			$response["quickcreate"] = true;
			$response["success"] = true;
			$response["id"] = $table->id;
			$response["title"] = $table->title;
			echo json_encode($response);
		}
		exit();	
	}
	
	public function checkTenExists()
	{
		$model = $this->getModel("Usergroup");
		$is_Exists = $model->checkTenExists();
		$str = "true";
		if($is_Exists)
		{
			$str = "false";
			
		}
		echo $str;
		exit();
	}
	
	function delete()
	{
		$model = $this->getModel("Usergroup");
		$model->delete();
		echo true;
		exit();
	}
}
